<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

namespace DAO;
use DataModule;
use Illuminate\Database\Capsule\Manager as DB;
\Common\DBInit::GetConnection();

/**
 * Description of DBReader
 *
 * @author David Wu
 */
class DBReader {
    //put your code here
    /*
     * alert: schema must in real node-tree 
     */
    public $schema;
    /*
     * alert: schema must in real node-tree 
     */
    public function __construct($schema){
        $this->schema = $schema;
    }
    /*
     * alert: schema must in real node-tree 
     */
    public function read($id){
        $table = $this->schema->realTableName();
        $model = new ApplicationDataModel($table);
        return $nodes = $model->find_($id);
    }
    public function readNode(string $nodeName, long $masterID){
        
        $table = $this->schema->realTableName();
        return ApplicationDataNode::find(1);
    }
    
}
